type Point = {
  x: number,
  y: number
}

function printCoord(pt: Point) {
  console.log(pt)
}

printCoord({
  x: 1,
  y: 2
})

type ID = number | string
function printId(id: ID) {

}
printId(100)
printId('Hello')

type UserInputSanitizedString = string
function sanitizedInput(str: string): UserInputSanitizedString {
  return str.slice(0, 2)
}

let userInput = sanitizedInput('Hello')
console.log(userInput)
userInput = 'new Input'
console.log(userInput)
